import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import Components from 'unplugin-vue-components/vite'
import {ElementPlusResolver} from 'unplugin-vue-components/resolvers'
// import vueDocs from 'vite-plugin-vue-docs';
// https://vitejs.dev/config/
export default defineConfig({
    plugins: [vue(),
        Components({
            resolvers: [ElementPlusResolver()],
        })
        // , vueDocs()
    ],
    build: {
        rollupOptions: {
            output: {}
        }
    },
    server: {
        proxy: {
            '/api': {
                target: 'http://localhost:8000',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, '')
            },
        }
    }
    ,
    resolve: {
        alias: {
            // "@element-plus":
            //     path.resolve(__dirname, "/node_modules/element-plus"),
            '@': path.resolve(__dirname, '/src'),
            // vue: 'vue/dist/vue.esm-bundler.js',
        },
    },
})
